    
    
subroutine read_Richter_tab(nv,RichDist,RichVal)
USE PARSE_CSV

character*80 line
integer nv,i,RichDist(100),ier,i1,i2
real*4       RichVal(100)
character*1 sep/','/

open(file='Richter.tab',status='old',readonly,unit=12)

! salta le prime due righe di intestazione
read(12,'(a)')line
read(12,'(a)')line

! legge i 70 valori tabellati
nv = 70
do i=1,nv
  line=' '
  read(12,'(q,a)',end=99)len,line
  i1=1
  call parse_csv_var(sep,ier,line,i1,i2,len, RichDist(i))
  call parse_csv_var(sep,ier,line,i1,i2,len, RichVal(i))
enddo


return

99 write(*,*)' errore: il file Richter.tab finisce prima del previsto'
   pause
   stop
end
